
//与flash通信的js接口
function publish_stream( obj ) {
	if( !obj.type ) {
		return false;
	}

	var func = '';
	try {
		func = obj.type;
		eval( func + "( obj );" );
	} catch (e) {
		alert( 'Error, No function ' + obj.type );
	}
	return 1;
}

function getSwfObj(objid) { //obtain the swf obj
	var a = {};
	if (window.document[objid]){
		a =  window.document[objid];
	}else if (navigator.appName.indexOf("Microsoft")==-1){
		if (document.embeds && document.embeds[objid])
			a =  document.embeds[objid];
	}else{
		a =  document.getElementById(objid);
	}
	return a;
}
function callSwf(iptid, objid) { //send con to swf and clear input area
	var obj = jQuery('#'+iptid);
	var value = obj.val();
	obj.val('');//set empty
	getSwfObj(objid).sendToActionScript(value);
}
